<template>
	<view class="u-m-t-20 u-m-l-30 u-m-r-30">
		<view class="u-card-box" v-if="presidentData.info.tea_status == 5 && presidentData.image">
			<view class="u-font-bold u-font-30 u-color-puce u-p-b-20">酒局合照</view>
			<image class="u-p-t-20 u-border-top" :src="presidentData.image" mode="widthFix" @click="previewPoster(3)"></image>
		</view>
		<view class="u-card-box u-m-t-30">
			<view class="u-font-bold u-font-30 u-color-puce u-p-b-20">青创私董介绍</view>
			<view class="u-flex u-border-top u-row-between u-col-top u-p-t-30 u-p-b-10"
				@click="toKnowPresident(presidentData.user.id)">
				<view>
					<u-image width="140rpx" height="140rpx" border-radius="20"
						:src="presidentData.user.head_img"></u-image>
					<view class="u-text-center u-font-24 u-m-t-15 number_box">
						<view class="u-font-bold u-font-26">{{presidentData.user.number}}</view>
						<view class="u-font-23 u-m-l-5">能量值</view>
					</view>
				</view>


				<view class="u-m-l-20 u-flex-1 u-flex-col u-row-between u-ellipsis">
					<view class="u-font-bold u-font-34 u-flex">
						<view class="u-m-r-10">{{ presidentData.user.name }}</view>
						<!-- <view class="u-m-r-10" v-if="presidentData.user && ![0,'0'].includes(presidentData.user.sex)">
							<u-icon size="32" :color="presidentData.user.sex == 1 ? '#4399FF' : '#FF69B1'"
								:name="presidentData.user.sex == 1 ? 'nanxing' : 'nvxing'"
								custom-prefix="custom-icon" />
						</view> -->
						<view class="u-m-r-10" v-if="presidentData.user.is_authentication == 2">
							<u-icon size="32" color="#FB6316" name="renzheng" custom-prefix="custom-icon" />
						</view>
						<view class="u-m-r-10" v-if="presidentData.user.is_company_user == 1">
							<u-icon size="32" color="#F8494D" name="qiye1" custom-prefix="custom-icon" />
						</view>
						<view class="u-tag-box" :class="presidentData.user.president_class"
							v-if="presidentData.user.president_class">{{ presidentData.user.president_name}}</view>
					</view>
					<view class="u-m-t-12 u-flex u-row-between u-ellipsis">
						<view class="u-m-r-10 u-ellipsis">{{presidentData.user.address}}</view>
						<view v-if="presidentData.user.is_friend == 0 && !isPromoter">
							<!-- <u-icon name="man-add-fill" color="#F96257" size="60"
								@click.native.stop="addPerson()"></u-icon> -->
							<view class="add_btn" @click.native.stop="addPerson()">添加好友</view>
						</view>
						<view v-else>
							<u-icon name="bodadianhua" custom-prefix="custom-icon" color="#F96257" size="60"
								@click.native.stop="callMobile(presidentData.user.phone)"></u-icon>
						</view>
					</view>
					<view class="u-m-t-20 u-flex u-row-around u-width-100">
						<view class="u-text-center">
							<view class="u-color-gray u-font-24">举办酒局</view>
							<view class="u-font-bold u-font-34 u-m-t-10">{{presidentData.user.space || 0}}场</view>
						</view>
						<view class="line"></view>
						<view class="u-text-center">
							<view class="u-color-gray u-font-24">参与酒局</view>
							<view class="u-font-bold u-font-34 u-m-t-10">{{presidentData.user.join_num || 0}}场</view>
						</view>
					</view>
					<view class="u-m-t-20 u-flex u-row-between" v-if="badgeData.count > 0">
						<view class="u-flex">
							<view>获得勋章：</view>
							<view class="u-flex">
								<u-image class="u-m-r-5" width="30rpx" height="30rpx" :src="item.icon" v-for="item in badgeData.list" :key="item.id"></u-image>
							</view>
						</view>
						<view @click="onSwitchBadgeList">共 {{ badgeData.count }} 枚></view>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="donate_btn" @click="viewDonateImage">创微基金捐赠</view> -->
		<view class="u-card-box u-m-t-30" v-if="presidentData.info.user_status == 11 && presidentData.info.weixin_url">
			<view class="u-font-bold u-font-30 u-color-puce u-p-b-20">请微信扫码，加入本场酒局群</view>
			<image class="u-p-t-20 u-border-top" :src="presidentData.info.weixin_url" mode="widthFix"
				@click="previewPoster(2)"></image>
		</view>
		<view class="u-card-box u-m-t-30">
			<view class="u-font-bold u-font-30 u-color-puce u-p-b-20">酒局流程</view>
			<view class="u-border-top u-p-t-30 u-p-b-10">
				<u-parse :html="presidentData.theme.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ["data", "isPromoter", "poster", "badgeData"],
		data() {
			return {
				presidentData: this.data
			}
		},
		watch: {
			data(newValue, oldValue) {
				this.presidentData = newValue
			}
		},
		methods: {
			toKnowPresident(val) {
				this.$emit("goTeaPersonDetail", val)
			},
			addPerson() {
				this.$emit("addPerson")
			},
			callMobile(val) {
				this.$emit("callMobile", val)
			},
			previewPoster(type) {
				this.$emit("previewPoster", type)
			},
			chooseThank() {
				this.$emit("chooseThank")
			},
			switchThanksList() {
				this.$emit("switchThanksList")
			},
			viewDonateImage(){
				this.$emit("viewDonateImage")
			}
		}
	}
</script>

<style lang="scss" scoped>
	.donate_btn {
		margin-top: 30rpx;
		background: #ee2424;
		color: #fff;
		padding: 25rpx;
		width: 100%;
		border-radius: 10rpx;
		text-align: center;
		font-size: 30rpx;
	}
</style>